﻿using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;

internal class FuckProtect
{
    private static Assembly assembly = typeof(FuckProtect).Assembly;
    private static byte[] bytes = new byte[0];
    internal static Hashtable hashtable_0 = new Hashtable();
    private static int[] int_0 = new int[0];
    private static IntPtr intptr_0 = IntPtr.Zero;
    private static IntPtr intptr_1 = IntPtr.Zero;
    private static IntPtr intptr_2 = IntPtr.Zero;
    private static SortedList sortedList = new SortedList();
    private static string[] string_0 = new string[0];

    static FuckProtect()
    {
        try
        {
            RSACryptoServiceProvider.UseMachineKeyStore = true;
        }
        catch
        {
        }
    }

    internal static string DataFrom(int Startindexs)
    {
        if (bytes.Length == 0)
        {
            BinaryReader reader = new BinaryReader(assembly.GetManifestResourceStream("PLCComHelperProj.db")) {
                BaseStream = { Position = 0L }
            };
            byte[] buffer = reader.ReadBytes((int) reader.BaseStream.Length);
            reader.Close();
            bytes = buffer;
        }
        int count = BitConverter.ToInt32(bytes, Startindexs);
        try
        {
            return Encoding.Unicode.GetString(bytes, Startindexs + 4, count);
        }
        catch
        {
        }
        return "";
    }
}

